WtrUtil

WaterGate comes with a maintenance utility program called WtrUtil that you can use to trim message bases, the log files and WaterGate's own databases.

To do this, you start WtrUtil and simply select one of the options from the menu. Alternatively, you can use command line options to start on of the options from - for example - a batchfile. Using the same command line functionality, you can also tell WtrUtil to only work on areas that are in a certain group or a certain set of groups. That way, you can limit the number of areas involved.

See the section on command line options for details.


Message base maintenance

Regarding message bases it can perform four important tasks:

Link

To allow your BBS program or message editor to follow discussion threads in a certain area, you need to have your messages linked together. This basically means that one message points to the next one.

You can use WtrUtil to link all message in all areas you have configured in WtrConf with a *.MSG, JAM or Squish message base selected.

WtrUtil uses different techniques to link messages, depending on the capabilities of a message base type. Usually the MSGID and REPLYID kludges are used.

Re-index

JAM and Squish message bases have an index file that allows your editor or BBS program to bring up a list of the messages present in an area, without browsing every single message.

It is sometimes necessary to reconstruct these index files, and you can do that with WtrUtil.

Renumber

If a add a message to an area, it gets a message number. Normally, every new messages gets the next highest message number. If you then delete a lot of messages, you get gaps that cannot be reused.

You can use WtrUtil to renumber all the messages in an area so they get sequential numbers again, starting with one. This also prevents an overflow of the highest possible message number.

In case of JAM, the index file has an entry for each message number, whether an actual message with that number is present or not. This means it costs disk space (only eight bytes per message number though) for not present messages. It can save some disk spaces to renumber your area. WtrUtil advises you to do so during an Index or Purge action if it finds a gap of at least 8k (1000 messages) in the index file. The gap from 1 to the first actually message doesn't "cost" any space though.

At this moment you can only renumber *.MSG and JAM areas.

Purge

You can't just keep on getting new message in a certain area. You wouldn't have the harddisk space to store them. So, you have to delete some messages every now and then. But if you delete messages, you get unused gaps in the message base, which you have to get rid of as well.

You can use WtrUtil to do all that automatically. It removes messages that have been deleted and recovers the storage space. You can also let WtrUtil delete messages that are too old (more than n days old), or simply set an upper limit on the number of messages you want to keep in an area.

You set the maximum age of a message and the maximum number of messages you want in a messages base in WtrConf under the area definition. WtrUtil reads that information.

The Squish and *.MSG purge code is a bit hard when deleting messages by number. *.MSG deletes the oldest message numbers and Squish the first ones in the base. Only JAM scans the base again and kills the oldest messages (by date), instead of the first ones in the base.


Log file and statistics file maintenance

You can use WtrUtil to trim the size of the WaterGate log file and statistics file. This functionality is called "shrinking" and you tell it the number of days of history you want to keep.

For example, telling it to "shrink 6" keeps today's information plus six days of history.

There are different option for shrinking the log file and the statistics file. Here are some examples:

WTRUTIL SHRINKLOG 6
WTRUTIL SHRINKSTA 14
It is advisable, especially when you have just started with WtrGate, to enable Debug Logging (all possible information) and to put a shrinklog statement in a batch file to keep the log file from growing enormous.

WaterGate's Databases

WaterGate's uses a number of database files where it keeps all the configuration information: system setup, users, areas, groups, mailing lists, which user wants which area, etc.

These databases are in binary format and you need the WtrConf program to make changes, although WtrGate updates information as well. For example, when a user connects an area using the built in AreaFix Manager or subscribes to a mailing list with the Mailing List Server.

When you delete users and areas, or when you unsubscribe users or areas, then WaterGate doesn't re-use the space because it would require additional information and processing time. It is so much easier to simply add new information at the end of the database.

To clean up these gaps, you use the Databases Maintenance option built into WtrUtil. It basically creates a new database and removes the empty space. Apart from that, it does a few other important things.

Pack databases has built in detection for some forms of corruption in the database structure. It can detect short loops in subscription lists (list of areas a user is subscribed to) and doesn't hang. Instead, it scans all the areas to see what the rest of the list should be and restores that list. Notice that WtrConf contains the same kind of detection mechanisms and warns you that it can't continue and you should pack the databases immediately.

You start this option by selecting "Pack Databases" from the menu or by typing the following on the command line.

WTRUTIL DATABASE
To safe a bit of time, you can prevent WtrUtil from sorting the areas by adding the command line option -NOSORT. This is mainly intended for very slow systems with a lot of areas. Faster systems should always sort the areas.

This is especially important if you have a lot of areas, because WtrConf sorts the areas when presenting a list and that can take a bit of time as well. Pre-sorting with WtrUtil saves you from waiting while WtrConf sorts that list with 3000 areas.

The databases are AREABASE.TDB, USERBASE.TDB, SUBSCRIPT.TDB, LISTSRV.TDB, GROUPS.TDB and WTRCFG.TDB. A copy of packed databases is kept in .OLD files.


Back to Table of Contents or continue to the next section.

Comments or questions? Send an e-mail to editor@wsd.wline.se.

Last updated 13 October 1996